<form onsubmit="return false" data-auto="true" action="{:request()->url()}" method="post" class='layui-form layui-card' autocomplete="off">
    <div class="layui-card-body">

        <div class="color-text margin-left-40 margin-bottom-20 layui-code text-center layui-bg-gray" style="border-left-width:1px">
            <p class="margin-bottom-5 font-w7">文件将存储在本地服务器，默认保存在 public/upload 目录，文件以 HASH 命名。</p>
            <p>文件存储的目录需要有读写权限，有足够的存储空间</p>
        </div>

        {include file='config/storage-0'}

        <div class="layui-form-item">
            <label class="layui-form-label label-required">
                <span class="color-green font-w7">访问协议</span><br><span class="nowrap color-desc">Protocol</span>
            </label>
            <div class="layui-input-block">
                {foreach ['follow','http','https','path','auto'] as $pro}
                <label class="think-radio">
                    {if sysconf('storage.local_http_protocol') eq $pro}
                    <input checked type="radio" name="storage.local_http_protocol" value="{$pro}" lay-ignore> {$pro}
                    {else}
                    <input type="radio" name="storage.local_http_protocol" value="{$pro}" lay-ignore> {$pro}
                    {/if}
                </label>
                {/foreach}
                <p class="help-block">本地服务器访问协议，其中 https 需要配置证书才能使用（follow 为跟随系统，path 为文件路径，auto 为相对协议）</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" for="storage.local_http_domain">
                <span class="color-green font-w7">访问域名</span><br><span class="nowrap color-desc">Domain</span>
            </label>
            <div class="layui-input-block">
                <input id="storage.local_http_domain" type="text" name="storage.local_http_domain" value="{:sysconf('storage.local_http_domain')}" placeholder="请输入上传后的访问域名 (非必填项)" class="layui-input">
                <p class="help-block">填写上传后的访问域名（不指定时根据当前访问地址自动计算），如：static.ctolog.com</p>
            </div>
        </div>

        <div class="hr-line-dashed margin-left-40"></div>
        <input type="hidden" name="storage.type" value="local">

        <div class="layui-form-item text-center padding-left-40">
            <button class="layui-btn" type="submit">保存配置</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消修改吗？" data-close>取消修改</button>
        </div>

    </div>
</form>